package com.ssmcrud.dao;

import com.ssmcrud.bean.Employee;
import com.ssmcrud.bean.EmployeeExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface EmployeeMapper {

    /*非逆向工程生成方法*/
    //连表查询员工和部门信息
    List<Employee> selectByExampleWithDept(EmployeeExample example);

    int countByExample(EmployeeExample example);

    Employee selectByPrimaryKey(Integer empId);

    @Select(" select  count(*) from tbl_emp where emp_id<=(select emp_id from tbl_emp where emp_name=#{empName}) ")
    int find(String empName);







    int deleteByExample(EmployeeExample example);

    int deleteByPrimaryKey(Integer empId);

    int insert(Employee record);

    int insertSelective(Employee record);

    List<Employee> selectByExample(EmployeeExample example);



    int updateByExampleSelective(@Param("record") Employee record, @Param("example") EmployeeExample example);

    int updateByExample(@Param("record") Employee record, @Param("example") EmployeeExample example);

    int updateByPrimaryKeySelective(Employee record);

    int updateByPrimaryKey(Employee record);
}